﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DcsGauges.Shared.Packets;

namespace DcsGauges.Shared.Network
{
    public class PacketReceivedEventArgs<TPacket> : EventArgs where TPacket : Packet
    {
        public TPacket Packet { get; private set; }

        public PacketReceivedEventArgs(TPacket packet)
        {
            this.Packet = (TPacket)packet;
        }
    }

    public interface INetworkChannel
    {
        void Send(Packet packet);

        event EventHandler<PacketReceivedEventArgs<DataPacket>>             DataPacketReceivedEvent;
        event EventHandler<PacketReceivedEventArgs<HandshakePacket>>        HandshakePacketReceivedEvent;
    }
}
